<?php
echo PHP_OS;
	$id=$_GET['id'];
	//连接数据库
	$con=new mysqli("localhost","root","123456","myDB");
	$con->query("set names utf8");
	//读取数据
	$count=$con->query("SELECT count(*) as count FROM users");
	$rw=$count->fetch_assoc();

	$sql="SELECT * FROM users WHERE id=$id";
	$result=$con->query($sql);
	$row=$result->fetch_assoc();
	//print_r($row);
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
	<title>测试编辑</title>
	<link rel="stylesheet" href="../../vender/sui/sui.min.css">
	<link rel="stylesheet" href="../../css/style.css">
	<link rel="stylesheet" href="../../css/admin.css">
</head>
<body>
<div class="content-title">
	<h4>测试编辑</h4>
</div>
<div class="content-wrapper">
	<form id="testAdd" class="sui-form form-horizontal" novalidate="novalidate" method="post" action="testEditApi.php">
		<input type="hidden" name="id" value="<?php echo $id ?>">
	    <div class="control-group">
	      <label class="control-label">手机号码：</label>
	      <div class="controls">
	        <input type="text" name="phone" placeholder="手机号码"  class="input-fat">
	      </div>
	    </div>
		<div class="control-group">
			<label class="control-label">密码：</label>
			<div class="controls">
				<input type="password" name="password" placeholder="密码" class="input-fat">
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">真实姓名：</label>
			<div class="controls">
				<input type="text" name="realName" placeholder="真实姓名：" class="input-fat">
			</div>
		</div>
	    <div class="control-group">
	      <label class="control-label"></label>
	      <div class="controls">
	        <button type="submit" class="sui-btn btn-primary">保存</button>
	      </div>
	    </div>
	</form> 
</div>
</body>
</html>
<script src="../../vender/jquery/jquery-1.11.1.js"></script>
<script src="../../vender/jquery/jquery.alerts.js"></script>
<script src="../../vender/sui/sui.js"></script>
<script src="../../scripts/admin.js"></script>
<script src="test.js"></script>
<?php
mysqli_connect('127.0.0.1', 'root', '123456') or die('数据库连接失败');
mysqli_select_db('myDB');
mysqli_query("set names 'utf8'");
$result = mysqli_query('select * from users');
$row = mysqli_fetch_assoc($result);
print_r($row);